;#############################
;命令：
;nasm -f elf64 day1_2for_1another.asm -o main.o && gcc main.o -o main -lc -no-pie && ./main
;输出：
;This is 0 !!!
;This is 1 !!!
;This is 2 !!!
;This is 3 !!!
;This is 4 !!!
;#############################
extern printf

section .data
	msg: db `This is %d !!!\n`, 0
	length: equ $ - msg

section .text
	global main

main:
	push rbp
	mov rbp, rsp

;###########################################
	;for (int i = 0; i < 5; ++i) {
	;    printf("This is %d !!!\n", i);
	;}
	mov ebx, 0

compare:
	cmp ebx, 5
	jge end
	mov rdi, msg
	movsxd rsi, ebx
	call printf

	inc ebx
	jmp compare
;###########################################

end:
	mov eax, 0
	leave
	ret
